package com.zxy.demo.guava.reflect;

import com.google.common.reflect.AbstractInvocationHandler;

import java.lang.reflect.Method;

/**
 * BaseInvocationHandler.
 *
 * Created by zxybird on 2017/11/27.
 */
public class BaseInvocationHandler<T> extends AbstractInvocationHandler {

  private T object;

  public BaseInvocationHandler(T object) {
    this.object = object;
  }

  @Override
  protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
    System.out.println("handleInvocation begin");
    return method.invoke(object, args);
  }
}
